using System;
using System.Globalization;
using EPiServer.Common.Globalization;

namespace EPiAbstractions.Common.Globalization
{
    public class GlobalizationHandlerFacade : IGlobalizationHandlerFacade
    {
        private static GlobalizationHandlerFacade _instance;

        public static GlobalizationHandlerFacade Instance
        {
            get
            {
                if (_instance == null)
                    _instance = new GlobalizationHandlerFacade();

                return _instance;
            }

            set { _instance = value; }
        }

        #region IGlobalizationHandlerFacade Members

        public virtual String[] FindTranslation(String searchText)
        {
            return GlobalizationHandler.FindTranslation(searchText);
        }

        public virtual CultureInfo[] GetKeyCultures(String key)
        {
            return GlobalizationHandler.GetKeyCultures(key);
        }

        public virtual String GetTranslation(String key)
        {
            return GlobalizationHandler.GetTranslation(key);
        }

        public virtual String GetTranslation(String key, CultureInfo culture)
        {
            return GlobalizationHandler.GetTranslation(key, culture);
        }

        public virtual void RemoveKey(String key)
        {
            GlobalizationHandler.RemoveKey(key);
        }

        public virtual void RemoveTranslation(String key, CultureInfo culture)
        {
            GlobalizationHandler.RemoveTranslation(key, culture);
        }

        public virtual void SetTranslation(String key, String text, CultureInfo culture)
        {
            GlobalizationHandler.SetTranslation(key, text, culture);
        }

        #endregion
    }
}